package com.yxjx.duoxue.datamodel.school;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

import com.yxjx.duoxue.datamodel.DMObject;
import com.yxjx.duoxue.utils.UIHelper;

/**
 * 老师情况
 *
 * @author zhangxs
 * @date 2015年2月6日
 *
 */
public class SchoolDetailTeacherDTS extends DMObject implements Serializable {

    /**
	 * 
	 */
	private static final long serialVersionUID = 6861114152264421062L;
	// private Integer schoolId = -1;
    // 教师数量
    private String teacherCount = "";
    // 平均教龄
    private String teacherAge = "";
    // 老师资历
    private String teacherQualifier = "";

    // public Integer getSchoolId() {
    // return schoolId;
    // }
    //
    // public void setSchoolId(Integer schoolId) {
    // this.schoolId = schoolId;
    // }

    public String getTeacherCount() {
        return teacherCount;
    }

    public void setTeacherCount(String teacherCount) {
        this.teacherCount = teacherCount;
    }

    public String getTeacherAge() {
        return teacherAge;
    }

    public void setTeacherAge(String teacherAge) {
        this.teacherAge = teacherAge;
    }

    public String getTeacherQualifier() {
        return teacherQualifier;
    }

    public void setTeacherQualifier(String teacherQualifier) {
        this.teacherQualifier = teacherQualifier;
    }

    @Override
    public String toString() {
        return "{\"teacherCount\":\"" + teacherCount + "\", \"teacherAge\":\"" + teacherAge + "\", \"teacherQualifier\":\"" + teacherQualifier + "\"}";
    }
    
    public static SchoolDetailTeacherDTS from(String str) {
    	if (UIHelper.isEmpty(str)) {
    		return null;
    	}
    	
    	try {
			JSONObject jo = new JSONObject(str);
			SchoolDetailTeacherDTS item = new SchoolDetailTeacherDTS();
			item.setTeacherAge(castString(jo,"teacherAge"));
			item.setTeacherCount(castString(jo,"teacherCount"));
			item.setTeacherQualifier(castString(jo,"teacherQualifier"));
			return item;
		} catch (JSONException e) {
			e.printStackTrace();
			return null;
		}
    }
}